#!/bin/bash

cp ../bsg_xianxue/shanghai/shanghai.json ./shanghai.j
cp ../bsg_xianxue/beijing/beijing.json ./beijing.j
cp ../bsg_xianxue/guangzhou/guangzhou.json ./guangzhou.j
cp ../xianxue/xianxue.js ./xianxue.js

./zhankai.sh shanghai.j > shanghai
./zhankai.sh beijing.j >beijing 
./zhankai.sh guangzhou.j >guangzhou 
./zhankai.sh xianxue.js >xianxue

grep "^..*}}[,]\?" beijing > /tmp/wmj_merge_beijin
grep "^..*}}[,]\?" shanghai> /tmp/wmj_merge_shanghai
grep "^..*}}[,]\?" guangzhou> /tmp/wmj_merge_guangzhou

echo "," >> /tmp/wmj_merge_beijin 
echo "," >> /tmp/wmj_merge_shanghai
echo "," >> /tmp/wmj_merge_guangzhou

cp /tmp/wmj_merge_beijin  beijing
cp /tmp/wmj_merge_shanghai  shanghai
cp /tmp/wmj_merge_guangzhou guangzhou

./delete_dup.out xianxue black_list /tmp/wmj_xianxue
sed "/'北京市':{'detail':{/r beijing" /tmp/wmj_xianxue | \
sed "/'上海市':{'detail':{/r shanghai" | \
sed "/'广东省':{'detail':{/r guangzhou" > /tmp/wmj_sed
./shousuo.sh /tmp/wmj_sed 

